/**  
 * All rights Reserved, Designed By www.woniuxy.com
 * @Title:  Account.java   
 * @Package com.woniu.domain   
 * @Description:    Description  
 * @author: 蜗牛学院  
 * @date:   2019年10月8日 上午11:34:12
 * @user:   Administrator  
 * @version V1.0 
 * @Copyright: 2019 www.woniuxy.com Inc. All rights reserved. 
 * 注意：本内容仅限于成都蜗牛创想科技有限公司，禁止外泄以及用于其他的商业目
 */ 
package com.moon.controller;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

import com.alibaba.fastjson.JSON;
import com.moon.utils.BaseController;

/**
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/remote")
public class RemoteController extends BaseController{
	@Autowired
	private RestTemplate rest;
	@RequestMapping("/check")
	public void check(String mobile,String msg,HttpServletResponse resp) throws IOException {
		String api="http://v.juhe.cn/sms/send?mobile=" + mobile + "&tpl_id=188494&tpl_value=%23code%23%3d" + msg
				+ "&key=ff55f3176ca70a91101a31088836fba8";		
		//Object obj = (Object) json;
		Object obj = rest.getForObject(api,Object.class);
		String json=JSON.toJSONString(obj);
		resp.getWriter().write(json);
		//super.printJson(resp,obj);
	}
}
